#ifndef USERSERVICE_H
#define USERSERVICE_H

#include <QObject>
#include <QCryptographicHash>
#include "entity/SysUser.h"

class UserService : public QObject
{
    Q_OBJECT
public:
    explicit UserService(QObject* parent = nullptr);

    Q_INVOKABLE void login(const QString& username, const QString& password);
    Q_INVOKABLE void logout();
    Q_INVOKABLE SysUser currentUser() const;

signals:
    void loginResult(bool success, const QString& message);

private:
    QString hashPassword(const QString& password) const;
};

#endif // USERSERVICE_H
